
package com.seekting.gongzhu.clientsdk;

import java.awt.image.ConvolveOp;
import java.util.List;

import com.google.gson.Gson;
import com.seekting.gongzhu.sdk.gson.AJson;
import com.seekting.gongzhu.sdk.gson.Card;
import com.seekting.gongzhu.sdk.gson.GsonConverter;
import com.seekting.gongzhu.sdk.gson.GsonHolder;
import com.seekting.gongzhu.sdk.gson.c2s.JsonC;

public class GGPlayer extends Player {
    private Card[] cards;
    private List<Card> mScore;
    private int index = -1;
    private Connector connector;

    public void prepare() {

    }

    public void recCard(Card card) {

    }

    public void recCards(List<Card> card) {

    }

    public void showCard(Card card) {

    }

    public int totalScore() {
        return 0;

    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    @Override
    public void leave() {

    }

    @Override
    public void searchGame() {

    }

    @Override
    public void join(String host) {
        connector.join(host);

    }

    @Override
    public void onFind(String ip) {
        System.out.println("找到啦!");
        join(ip);
    }

    @Override
    public void onNotFind() {

    }

    public Connector getConnector() {
        return connector;
    }

    public void setConnector(Connector connector) {
        this.connector = connector;
    }

    @Override
    public void send(String ip, String str) {

    }

    @Override
    public void onReceive(String ip, String str) {
        GsonHolder gsonHolder = new Gson().fromJson(str, GsonHolder.class);
        AJson aJson = GsonConverter.convertJson(gsonHolder.getAction(), gsonHolder.getJson());
        System.out.println("收到了" + aJson.getClass().getName());

    }

}
